﻿using DicomSCUDemo;
using System.Windows;
using System.Windows.Controls;

namespace LS.Dicom.Tools
{
    /// <summary>
    /// DicomUploadView.xaml 的交互逻辑
    /// </summary>
    public partial class DicomUploadView : UserControl
    {
        DicomUploadViewModel ViewModel => this.DataContext as DicomUploadViewModel;
        public DicomUploadView()
        {
            InitializeComponent();
            txtAET.Text = Properties.Settings.Default.AET;
            txtIp.Text = Properties.Settings.Default.IP;
            txtPort.Text = (Properties.Settings.Default.Port == 0 ? 60000 : Properties.Settings.Default.Port).ToString();
        }
        private void btn_Clean_Click(object sender, RoutedEventArgs e)
        {
            ViewModel.Clear();
        }

        private void btn_ToList_Click(object sender, RoutedEventArgs e)
        {
            ViewModel.SelectFiles();
        }

        private void btn_Start_Click(object sender, RoutedEventArgs e)
        {
            ViewModel.Start();
        }
        private void btn_Stop_Click(object sender, RoutedEventArgs e)
        {
            ViewModel.Stop();
        }

        private void btn_ReStart_Click(object sender, RoutedEventArgs e)
        {
            ViewModel.ReStart();
        }
    }
}